<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>Document</title>
	<script src="datePicker.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
	<input type="text" name="" id="" value="" />
	<script type="text/javascript">
		let input = document.querySelector('input');
		input.onfocus = function () {
			var calendar = new datePicker();
			calendar.init({
	        'trigger': 'input', /*按钮选择器，用于触发弹出插件*/ 
	        'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
	        'minDate':'1949-1-1',/*最小日期*/
	        'maxDate':'2100-12-31',/*最大日期*/
	        'onSubmit':function(){/*确认时触发事件*/
	            var theSelectData=calendar.value;
	        },
	        'onClose':function(){/*取消时触发事件*/
				//确认的时候也会触发取消事件
	       		console.log('取消');
	        }
    });
		}
	</script>
</body>
</html>